//
//  UIView+Category.swift
//  SinaWebo
//
//  Created by mis on 16/3/21.
//  Copyright © 2016年 mis. All rights reserved.
//

import UIKit

extension UIView {
    func NavController() -> UINavigationController? {
        // 遍历响应者链条 获取navigation控制器
        var next = self.nextResponder()
        repeat {
            if next is UINavigationController {
                return next as? UINavigationController
            }
            next = next?.nextResponder()
        }while (next != nil)
        return nil
    }
}